package PlaneGame.CODE;
import static PlaneGame.CODE.GameFrame.*;
public class SuspendButton extends GameButton{
    public SuspendButton(int width, int height, int x, int y, int imageNumber, String[] paths) {
        super(width, height, x, y, imageNumber, paths);
    }
    void suspend(){
        suspendFlag=!suspendFlag;
        exitButton.shift();
        againButton.shift();
        if (suspendFlag) {
            yaoBGM.ting();
        }else{
            yaoBGM.fang();
        }
    }
    @Override
    void nextDrawPos() {
        if(drawPos<imageNumber-1){//切换下一张
            drawPos++;
        }else {//若播到最后一张则切回第一张
            drawPos=0;
        }
    }
    @Override
    void pressEffect() {
        nextDrawPos();
    }
    @Override
    void releaseEffect() {
        nextDrawPos();
        suspend();
    }
    @Override
    void clickEffect() {

    }
    @Override
    void change() {

    }
}
